package cci.bdd;

import java.util.List;

import cci.dao.DAO;
import cci.pojo.Personne;

public class PersonneDB {

	private DAO<Personne> database = null;
	
	private boolean logged = false;
	
	private int personneId = 0;
	
	public PersonneDB() {}
	
	public DAO<Personne> getDatabase () {
		return database;
	}
	
	public void setDatabase(DAO<Personne> database) {
		this.database = database;
	}
	
	public int getPersonneId() {
		return personneId;
	}
	
	public void setPersonneId(int personneId) {
		this.personneId = personneId;
	}
		
	public List<Personne> getPersonnes() {
		return database.findAll();
	}
	
	public Personne getPersonne() {
		return database.find(personneId);
	}

	public synchronized boolean isLogged() {
		return logged;
	}

	public synchronized void setLogged(boolean logged) {
		this.logged = logged;
	}
}	
	
	
